#ifndef LONGKEY_COMMON_COMMAND_LINE_BUILDER_H__
#define LONGKEY_COMMON_COMMAND_LINE_BUILDER_H__

#include <atlstr.h>
#include "command_line.h"

// This class builds a LongkeyPCAgent.exe command line and makes sure it's
// valid against the GoopdateCommandLineValidator.
class CommandLineBuilder
{
public:
	explicit CommandLineBuilder(CommandLineMode mode);
	~CommandLineBuilder();

	CommandLineMode mode() const { return mode_; }

	// Outputs the proper command line string for the properties that are set.
	// If the properties aren't in a valid combination, function will assert.
	CString GetCommandLineArgs()  const;

private:
	CString GetSingleSwitch(const CString& switch_name) const;

	CString GetRegServer() const;
	CString GetUnregServer() const;
	CString GetServiceRegister() const;
	CString GetServiceUnregister() const;
	CString GetService() const;
	CString GetComServer() const;

	const CommandLineMode mode_;

	DISALLOW_EVIL_CONSTRUCTORS(CommandLineBuilder);
};

#endif	// LONGKEY_COMMON_COMMAND_LINE_BUILDER_H__
